<?

$fs_inv_ctl_products = new Fieldset (array (
	db_conn=>$_GLOBAL_DBH,
	relation=>"inv_ctl_products",
	title=>"Inventory Products",
	fieldset=>array (
		array (name=>"id",label=>"ID",type=>"numeric",
				value=>$_REQUEST["product_id"],
				input=>"hidden",primary_key=>true),
		array (name=>"item_id",label=>"Item",type=>"any",
				relation=>array(foreign=>"inv_ctl_items",key=>"id",
				field=>"name"),
				input=>"select",
				options=>"_app_select_query",
				options_params=>"SELECT id,name FROM inv_ctl_items",
				columns=>array (key=>"id",value=>"name"),
		),
		array (name=>"category_id",label=>"Category ID",type=>"any",
				relation=>array(foreign=>"inv_ctl_categories",key=>"id",
				field=>"name"),
				input=>"select",
				options=>"_app_select_query",
				options_params=>"SELECT id,name FROM inv_ctl_categories",
				columns=>array (key=>"id",value=>"name"),
		),
		array (name=>"status_id",label=>"Status ID",type=>"any",
				relation=>array(foreign=>"inv_ctl_status",key=>"id",
				field=>"name"),
				input=>"select",
				options=>"_app_select_query",
				options_params=>"SELECT id,name FROM inv_ctl_status",
				columns=>array (key=>"id",value=>"name"),
		),
		array (name=>"unit_price",label=>"Unit Price",type=>"decimal",
				input=>"field"),
		array (name=>"available",label=>"Date Available",type=>"any",
				input=>"date",value=>_app_date("available")),
               ),
));

$fs_inv_ctl_products->parse ();

?>
